package com.yanghang.service;

import com.yanghang.dao.ExamDao;
import com.yanghang.entity.Exam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class ExamServiceImpl implements  ExamService {
    @Autowired
    private ExamDao ed;
    @Override
    public void insert(Exam exam) {
      ed.insert(exam);
    }

    @Override
    public void delete(int id) {
        ed.deleteById(id);
    }

    @Override
    public void update(Exam exam) {
            ed.updateById(exam);
    }

    @Override
    public Exam selectOne(int id) {
        return ed.selectById(id);
    }

    @Override
    public List<Exam> selectAll() {
        return ed.selectList(null);
    }
}
